import React from "react";
import { connect } from "dva";
import { View, Text } from "react-native";
import H5Nav from "../lib/H5Nav";
class Test extends React.Component {
  _goBack = () => {
    H5Nav.goBack();
  };
  _getParams = () => {
    console.log("params", H5Nav.getParams());
  };
  _goHome = () => {
    H5Nav.goHome();
  };
  _backTo = () => {
    H5Nav.backTo("/");
  };
  render() {
    return (
      <View>
        <Text>{this.props.testdata}</Text>
        <div onClick={this._getParams}>获取push参数</div>
        <div onClick={this._goBack}>goBack</div>
        <div onClick={this._goHome}>返回首页</div>
        <div onClick={this._backTo}>返回指定页面</div>
      </View>
    );
  }
}

export default connect(({ test }) => {
  return {
    testdata: test.testdata
  };
})(Test);
